using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace AnQinFrameWorkAPI.Entity.Finance.Entity;

/// <summary>
///     用户账户表
/// </summary>
[Table("FinanceUserAccount")]
public class FinanceUserAccount
{
    #region 字段

    /// <summary>
    ///     id
    /// </summary>
    [Key]
    [MaxLength(36)]
    public Guid Id { get; set; }

    /// <summary>
    ///     用户id
    /// </summary>
    [MaxLength(36)]
    public Guid FinanceUserId { get; set; }

    /// <summary>
    ///     账户名称
    /// </summary>
    [MaxLength(100)]
    public string AccountName { get; set; }

    /// <summary>
    ///     账户余额
    /// </summary>
    [Column(TypeName = "decimal(18, 2)")]
    public decimal AccountBalance { get; set; }

    /// <summary>
    ///     创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    #endregion

    #region 关联

    /// <summary>
    ///     财务用户
    /// </summary>
    public virtual FinanceUserModel FinanceUser { get; set; }

    /// <summary>
    ///     财务明细列表
    /// </summary>
    public virtual ICollection<FinanceDetailModel> FinanceDetails { get; set; } = new List<FinanceDetailModel>();

    #endregion
}